//
// Created by liushuai on 2021/2/21.
//

#include "findComplement.h"
int findComplement(int num){
    int current = num;
    int count = 0;
    while (current){
        current = current>>1;
        count+=1;
    }
    long long val = std::pow(2,count)-1;
    return val^num;
}